import request from './request'

// 获取当前学生加入的老师信息
export const getMyTeacher = () => {
  return request({
    url: '/student/my-teacher',
    method: 'get'
  })
}

// 加入老师班级
export const joinTeacher = (data) => {
  return request({
    url: '/auth/student/join-teacher',
    method: 'post',
    data
  })
}

// 获取待签到活动列表
export const getPendingSignActivities = () => {
  return request({
    url: '/student/pending-sign-activities',
    method: 'get'
  })
}

// 普通签到
export const normalSign = (activityId) => {
  return request({
    url: `/student/sign-activities/${activityId}/sign`,
    method: 'post'
  })
}

// 签到码签到
export const codeSign = (activityId, signCode) => {
  return request({
    url: `/student/sign-activities/${activityId}/code-sign`,
    method: 'post',
    data: { signCode }
  })
}
// 九宫格签到
export const gestureSign = (activityId, gesturePoint) => {
  return request({
    url: `/student/sign-activities/${activityId}/gesture-sign`,
    method: 'post',
    data: { gesturePoint }
  })
}

// 位置签到
export const locationSign = (activityId, lat,lng) => {
  return request({
    url: `/student/sign-activities/${activityId}/location-sign`,
    method: 'post',
    data: { lat, 
          lng
          }
  })
}
// 获取签到记录
export const getSignRecords = () => {
  return request({
    url: '/student/sign-records',
    method: 'get'
  })
}

// 获取所有签到活动
export const getSignActivities = () => {
  return request({
    url: '/student/sign-activities',
    method: 'get'
  })
}

// 获取已过期未签到记录
export const getExpiredUnsignedActivities = () => {
  return request({
    url: '/student/expired-unsigned-activities',
    method: 'get'
  })
}

// 扫码签到
export const qrCodeSign = (data) => {
  return request({
    url: '/student/sign/qrcode',
    method: 'post',
    data
  })
} 